<%@ page import="com.User" %><%--
  Created by IntelliJ IDEA.
  User: 31921
  Date: 2024/12/14
  Time: 23:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<html>
    <head>
        <title>学生管理系统 - 首页</title>
        <%--样式设计--%>
        <style>
            body {
                font-family: Arial, sans-serif;
                background-color: #f4f4f4;
                margin: 0;
                padding: 0;
            }
            .header {
                background-color: #4cafa0;
                color: white;
                padding: 10px 0;
                height: 20vh;
                text-align: center;
            }
            .container {
                display: flex;
            }
            .sidebar {
                width: 200px;
                height: 50vh;
                background-color: #f1f1f1;
                padding: 20px;
            }
            .main-content {
                flex: 1;
                padding: 20px;
            }
            .menu-item {
                padding: 10px;
                margin-bottom: 10px;
                background-color: #fff;
                border: 1px solid #ddd;
                cursor: pointer;
            }
            .menu-item:hover {
                background-color: #e7f3e7;
            }
            .footer {
                text-align: center;
                padding: 15px;
                background-color: #4cafa7;
                color: white;
            }
        </style>
    </head>
    <body>

        <!-- 头部 -->
        <div class="header">
            <h1>欢迎来到学生管理系统</h1>
            <%
                User user = (User) session.getAttribute("user");
                if (user != null) {
            %>
            <p>欢迎，<%= user.getUsername() %></p>
            <% } else { %>
            <p>欢迎，游客</p>
            <% } %>
            <a href="logout" style="color: white;">退出登录</a>
        </div>

        <div class="container">
            <!-- 功能页面 -->
            <div class="sidebar">
                <div class="menu-item" onclick="window.location.href='studentManagement'">学生管理</div>
                <%--<div class="menu-item" onclick="window.location.href='courseManagement.jsp'">课程管理</div>--%>
                <div class="menu-item" onclick="window.location.href='gradeManagement'">成绩管理</div>
                <div class="menu-item" onclick="window.location.href='announcement.jsp'">公告</div>
                <div class="menu-item" onclick="window.location.href='userManagement'">用户管理</div>
            </div>

            <!-- 主区域 -->
            <div class="main-content">
                <h2>系统功能</h2>
                <p>在这里，你可以查看学生信息、管理课程、查看成绩等。</p>
            </div>
        </div>

        <!-- 尾部标识 -->
        <div class="footer">
            <p>&copy; 2024 学生管理系统</p>
        </div>

    </body>
</html>

